import * as types from "./mutation-types";
import Vue from "vue";

export default {
  increment(state) {
    state.count++
  },
  decrement(state) {
    state.count--
  },
  // mutations传递参数
  add(state, count) {
    state.count += count
  },
  // mutations传递对象
  dec(state, payload) {
    state.count -= payload.count
  },
  insertStudent(state, payload) {
    state.students.push(payload);
  },
  updateStudent(state, payload) {
    state.students.splice(3, 1, payload)
  },
  [types.UPDATE_INFO](state, payload) {
    Vue.set(state.info, 'height', payload.height)
  }
}
